<?php

/**
 * GalleryUploadForm class
 *
 * @author Julot <andy.julot@gmail.com>
 * @since Tuesday, August 9, 2011. 05:43 PM
 */
class FileForm extends CFormModel {

	public $file;
	public $path;
	public $name;

	/**
	 * @return array validation rules for model attributes.
	 */
	public function rules() {
		// NOTE: you should only define rules for those attributes that
		// will receive user inputs.
		return array(
			array(
				'file',
				'file',
				'types'=>'jpg, gif, png',
				'maxSize'=>10485760,
				'allowEmpty'=>false,
				'on'=>'upload-gallery',
			),
			array(
				'file',
				'file',
				'maxSize'=>10485760,
				'allowEmpty'=>false,
				'on'=>'upload-download',
			),
			array(
				'name',
				'required',
				'on'=>'rename, add-folder-gallery, add-folder-download'),
			array('path', 'safe'),
		);
	}

	/**
	 * @return array customized attribute labels (name=>label)
	 */
	public function attributeLabels() {
		return array(
			'file'=>'File',
			'path'=>'Lokasi',
			'name'=>'Nama',
		);
	}

	public function getMenuItems() {
		
	}

}
